package com.cyt.chattlibrary.face;

import android.content.Context;
import android.text.SpannableStringBuilder;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.cyt.chattlibrary.recoder.AudioFocusChangeManager;
import com.cyt.chattlibrary.recoder.AudioMediaPlayer;
import com.homegoods.aroutercomment.ARouterPath;
import com.homegoods.aroutercomment.SmileyParserService;

import java.util.regex.Pattern;

/**
 * @author QiQi
 * @ClassName: SmileyParserImpl
 * @date 2018/10/22
 * @description
 */
@Route(path = ARouterPath.PATH_SMILEY_SERVICE)
public class SmileyParserImpl implements SmileyParserService {
    @Override
    public SpannableStringBuilder addParser(CharSequence sequence, float textSize) {
        return SmileyParser.getInstance().addSmileySpans(sequence, textSize);
    }

    @Override
    public Pattern getPattern() {
        return SmileyParser.getInstance().getPattern();
    }

    @Override
    public void init(Context context) {
        SmileyParser.init(context);
        AudioFocusChangeManager.init(context);
        AudioMediaPlayer.getInstance().init(context);
    }
}
